package com.shendu.task.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.shendu.task.domain.RetVo;
import com.shendu.task.domain.UserDoc;
import com.shendu.task.service.UserService;

@RestController
@RequestMapping("/user")
public class UserController {
	@Autowired
	private UserService userService;
	@RequestMapping("/login")
	public RetVo login(@RequestBody UserDoc user) {
		return userService.login(user);
	}
	@RequestMapping("/checkUser")
	public boolean checkUser(@RequestBody UserDoc user) {
		return userService.checkUser(user)==null;
	}
	@RequestMapping("/list")
	public RetVo list(UserDoc user) {
		return new RetVo(userService.list(user));
	}
}
